﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wicresoft.UnifyShow.Business
{
    public interface IAlert
    {
        List<AlertDetailAndDevice> GetAlertBySiteBSAndDeviceID(int siteID, int bsID, int? deviceID, out Decimal totalRecords, int pageSize = -1, int pageIndex = -1,
            string sortName = "Timestamp", string sortDirection = "Descending"/*Ascending,Descending*/);
        List<AlertModel> GetOpenAlertBySiteID(int site, DateTime? sTime, DateTime? eTime, int? ps, int? pi);
        List<AlertDetailAndDevice> GetAlertBySiteAndDeviceID(int? siteID, int? deviceID, out Decimal totalRecords, int pageSize = -1, int pageIndex = -1,
            string sortName = "Timestamp", string sortDirection = "Descending"/*Ascending,Descending*/);

        /// <summary>
        /// 获取今日新产生的告警
        /// </summary>
        /// <param name="siteID"></param>
        /// <param name="count"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<AlertDetailAndDevice> GetAlertCreateInToday(int? siteID, out decimal count, int pageIndex, int pageSize, string sort = "CreateTime", string order = "Descending");

        /// <summary>
        /// 获取今天之前产生并且未关闭的告警
        /// </summary>
        /// <param name="siteID"></param>
        /// <param name="count"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<AlertDetailAndDevice> GetNoClosedAlert(int? siteID, out decimal count, int pageIndex, int pageSize, string sort = "CreateTime", string order = "Descending");

        /// <summary>
        /// 是否显示挂起的告警
        /// </summary>
        /// <returns></returns>
        bool HasIncludePendingAlert();

        bool UpdateIncludePendingAlert(decimal value);
    }
}
